var ns;
var app = new Vue({
    el: '#app',
    data: {
        form: {
            keywords: '',
            pageindex: 0,
            pagesize: 10,
        },
        scroll_top: 0,
        can_scroll: true,
        is_searching: false,
        list:[],
        EncriptID: "",
        isactive:-1
    },
    methods: {
        get_data: function() {
            var that = this;
            that.can_scroll = false;
            var options = {};
            options.action = "getdevicecollectdevicelist";
            options.QRCode = that.EncriptID;
            ns.post(options, function(succeed, data, err) {
                // console.log(JSON.stringify(data));
                if (succeed) {
                    that.list = data.list;
                } else if (err) {
                    that.list = [];
                    api.toast({
                        msg: err,
                        duration: 2000,
                        location: 'bottom'
                    });
                }
            }, {
                toast: true
            });
        },
        do_search: function() {
            var that = this;
            that.get_data();
        },
        doOpenDetail: function(item,index) {
            var that = this;
            that.isactive=index;
            //跳转详情 
            ns.openWin('equipment_homedetail', '设备信息详情', {
                ID: item.ID
            });
            return;
        },
    }
});
apiready = function() {
    api.parseTapmode();
    ns = window.Foresight.Util;
    toast = new auiToast();
    app.EncriptID = api.pageParam.id || "";
    app.get_data();

    ns.init_search();
    ns.init_pull();
}
